#!/bin/bash

echo "Update current jrd-l10n directory by strings.xls..."
python build/jrd_perso_gen/jrd_xlsToFiles.py

echo "Merge gaia-l10n and jrd-l10n..."
cd gaia/jrd-l10n/
./JrdTranslate.pl

echo "Check translation strings..."
cp -p TranslateCheck.pl out
cd out
./TranslateCheck.pl
cd ..

echo "Copy directory gaia/jrd-l10n/out to out/l10n..."
if [ -d "../../out/l10n/" ]
    then
        echo "Already have out/l10n dirctory!"
    else
        echo "Make new out/l10n directory!"
        mkdir "../../out/"
        mkdir "../../out/l10n/"
fi
cp -rf out ../../out/l10n/
cd ../../

echo "Generate all.xls from the newly merged translation dirctory..."
python build/jrd_perso_gen/jrd_allTranslationToXls.py

echo "Generate all.xls successed! --> ffos_wimdata_ng/wlanguage/src/all.xls"